/*
Navicat MySQL Data Transfer

Source Server         : nd
Source Server Version : 50717
Source Host           : localhost:3306
Source Database       : hy_edu_resource

Target Server Type    : MYSQL
Target Server Version : 50717
File Encoding         : 65001

Date: 2018-01-18 14:38:48
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for hy_article
-- ----------------------------
DROP TABLE IF EXISTS `hy_article`;
CREATE TABLE `hy_article` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT COMMENT '文章id' ,
`title`  text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '文章标题' ,
`sub_title`  text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '文章二级标题' ,
`content`  longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '文章内容' ,
`type`  bigint(20) NULL DEFAULT NULL COMMENT '文章类型' ,
`author`  varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章作者' ,
`create_time`  datetime NULL DEFAULT NULL COMMENT '文章创建时间' ,
`modify_time`  datetime NULL DEFAULT NULL COMMENT '文章修改时间' ,
`view_count`  int(11) NULL DEFAULT 0 COMMENT '文章被浏览的次数' ,
`modify_user_id`  bigint(20) NULL DEFAULT NULL COMMENT '文章最后修改用户id' ,
`source`  varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章来源' ,
`keywords`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章搜索关键词' ,
`img`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章缩略图' ,
`publish`  tinyint(4) NULL DEFAULT 0 ,
`publish_time`  datetime NULL DEFAULT NULL ,
`attachments_notation`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '附件说明' ,
`relative_article`  varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '相关文章' ,
`file_ids`  bigint(20) NULL DEFAULT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
COMMENT='文章表'
AUTO_INCREMENT=75

;


-- ----------------------------
-- Table structure for hy_article_type
-- ----------------------------
DROP TABLE IF EXISTS `hy_article_type`;
CREATE TABLE `hy_article_type` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id' ,
`name`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章类型名称' ,
`parent_id`  bigint(20) NOT NULL DEFAULT 0 COMMENT '上级类型id' ,
`create_time`  datetime NULL DEFAULT NULL COMMENT '类型创建时间' ,
`img`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类型缩略图' ,
`grand_parent_id`  bigint(20) NULL DEFAULT 0 COMMENT '祖父id' ,
`publish`  tinyint(4) NULL DEFAULT 0 COMMENT '是否发布,该分类是否可见' ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
COMMENT='文章类型'
AUTO_INCREMENT=52

;

-- ----------------------------
-- Records of hy_article_type
-- ----------------------------
BEGIN;
INSERT INTO `hy_article_type` VALUES ('19', '关于华渔', '0', '2017-12-26 06:18:36', '', '0', '0'), ('24', '华渔定见', '0', '2017-12-26 06:24:17', '', '0', '0'), ('25', '华渔视界', '0', '2017-12-26 06:24:38', '', '0', '0'), ('29', '华渔准则', '0', '2017-12-26 06:24:51', '', '0', '0'), ('31', '标准文档', '0', '2017-12-26 06:25:32', '', '0', '0'), ('32', '高层声音', '0', '2017-12-26 06:25:44', '', '0', '0'), ('33', '新闻资讯', '0', '2017-12-26 06:25:59', '', '0', '0'), ('34', '公告', '0', '2017-12-26 06:26:08', '', '0', '0'), ('35', '华渔简介', '19', '2017-12-26 11:05:53', '', '0', '0'), ('36', '品牌关键词', '19', '2017-12-26 11:06:03', '', '0', '0'), ('37', '华渔大事件', '19', '2017-12-26 11:06:13', '', '0', '0'), ('38', '官方数据', '19', '2017-12-26 11:06:22', '', '0', '0'), ('39', '华渔定见', '24', '2017-12-26 11:06:36', '', '0', '0'), ('40', '华渔视界', '25', '2017-12-26 11:07:17', '', '0', '0'), ('41', '品牌管理准则', '29', '2017-12-26 11:07:30', '', '0', '0'), ('42', '核心信息规范', '29', '2017-12-26 11:07:39', '', '0', '0'), ('43', '品牌手册', '31', '2017-12-26 11:07:48', '', '0', '0'), ('44', '标准易错点', '31', '2017-12-26 11:07:57', '', '0', '0'), ('45', 'Q&A', '31', '2017-12-26 11:08:05', '', '0', '0'), ('46', '高层声音', '32', '2017-12-26 11:08:15', '', '0', '0'), ('47', '产品相关报道', '33', '2017-12-26 11:08:31', '', '0', '0'), ('48', '活动相关报道', '33', '2017-12-26 11:08:47', '', '0', '0'), ('49', '业务相关报道', '33', '2017-12-26 11:09:03', '', '0', '0'), ('50', '领导人报道新闻', '33', '2017-12-26 11:09:14', '', '0', '0'), ('51', '公告', '34', '2017-12-26 11:09:22', '', '0', '0');
COMMIT;

-- ----------------------------
-- Table structure for hy_banner
-- ----------------------------
DROP TABLE IF EXISTS `hy_banner`;
CREATE TABLE `hy_banner` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id' ,
`resource_id`  bigint(20) NULL DEFAULT 0 COMMENT '关联的资源文件id' ,
`href`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '点击链接' ,
`name`  varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题' ,
`create_time`  datetime NULL DEFAULT NULL COMMENT '创建时间' ,
`modify_time`  datetime NULL DEFAULT NULL COMMENT '修改时间' ,
`img`  varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '轮播图片地址' ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
COMMENT='轮播图表'
AUTO_INCREMENT=4

;

-- ----------------------------
-- Records of hy_banner
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for hy_folder
-- ----------------------------
DROP TABLE IF EXISTS `hy_folder`;
CREATE TABLE `hy_folder` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT COMMENT '资源文件夹id' ,
`name`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件夹名称' ,
`create_time`  datetime NULL DEFAULT NULL COMMENT '文件夹创建时间' ,
`create_username`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '4)文件夹创建人名' ,
`create_userid`  bigint(20) NULL DEFAULT NULL COMMENT '5)文件夹创建人id' ,
`parent_id`  bigint(20) NULL DEFAULT 0 COMMENT '上级文件夹id' ,
`grand_parent_id`  bigint(20) NULL DEFAULT 0 COMMENT '祖父文件夹id' ,
`delete_flag`  int(11) NULL DEFAULT 0 ,
`modify_time`  datetime NULL DEFAULT NULL COMMENT '修改时间' ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
COMMENT='资源文件夹'
AUTO_INCREMENT=1

;

-- ----------------------------
-- Records of hy_folder
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for hy_operation_log
-- ----------------------------
DROP TABLE IF EXISTS `hy_operation_log`;
CREATE TABLE `hy_operation_log` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id' ,
`create_time`  datetime NULL DEFAULT NULL COMMENT '操作时间' ,
`target_id`  bigint(20) NULL DEFAULT NULL COMMENT '操作对象id' ,
`target_type`  int(11) NULL DEFAULT NULL COMMENT '操作对象类型（文章，或者资源）' ,
`type`  int(11) NULL DEFAULT NULL COMMENT '操作类型（浏览与下载，或者其他）' ,
`user_id`  bigint(20) NULL DEFAULT NULL COMMENT '操作用户的id' ,
`update_time`  datetime NULL DEFAULT NULL COMMENT '最新浏览时间' ,
`times`  int(11) NULL DEFAULT 1 COMMENT '改用户的操作次数' ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
COMMENT='操作记录表'
AUTO_INCREMENT=3

;

-- ----------------------------
-- Records of hy_operation_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for hy_source
-- ----------------------------
DROP TABLE IF EXISTS `hy_source`;
CREATE TABLE `hy_source` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT COMMENT '资源id' ,
`name`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源名称' ,
`url`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源物理地址' ,
`type`  bigint(20) NULL DEFAULT NULL COMMENT '资源类型（图片，文档，视频）【这个现阶选配置在文件中，之后又扩展放在数据库中】' ,
`folder_id`  bigint(20) NULL DEFAULT 0 COMMENT '资源归属文件夹' ,
`create_time`  datetime NULL DEFAULT NULL COMMENT '资源上传时间' ,
`download`  int(11) NULL DEFAULT 0 COMMENT '资源被下载量' ,
`view`  int(11) NULL DEFAULT 0 COMMENT '资源浏览量' ,
`size`  bigint(20) NULL DEFAULT 0 COMMENT '资源大小' ,
`mime`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资源类型字符' ,
`delete_flag`  int(11) NULL DEFAULT 0 COMMENT '删除标志位' ,
`modify_time`  datetime NULL DEFAULT NULL COMMENT '修改时间' ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
COMMENT='资源表'
AUTO_INCREMENT=6

;

-- ----------------------------
-- Records of hy_source
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for hy_user
-- ----------------------------
DROP TABLE IF EXISTS `hy_user`;
CREATE TABLE `hy_user` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id' ,
`user_name`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用户名' ,
`password`  varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码' ,
`user_id`  bigint(20) NULL DEFAULT NULL ,
`real_name`  varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,
`nick_name`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,
`email`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,
`mobile`  varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,
`avatar`  varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,
`gender`  text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL ,
`user_type`  text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL ,
`grade_name`  varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,
`grade_value`  varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,
`org_node_name`  varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ,
`create_time`  datetime NULL DEFAULT NULL ,
`update_time`  datetime NULL DEFAULT NULL ,
`created_ip`  bigint(20) NULL DEFAULT NULL ,
`updated_ip`  bigint(20) NULL DEFAULT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
COMMENT='用户表'
AUTO_INCREMENT=41

;


-- ----------------------------
-- Table structure for hy_visit_log
-- ----------------------------
DROP TABLE IF EXISTS `hy_visit_log`;
CREATE TABLE `hy_visit_log` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT COMMENT '访问id' ,
`year`  int(11) NULL DEFAULT NULL COMMENT '访问记录的年份' ,
`create_time`  datetime NULL DEFAULT NULL COMMENT '访问记录的日期' ,
`visit_url`  varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '访问的页面地址' ,
`month`  int(11) NULL DEFAULT NULL COMMENT '访问的月份' ,
`user_id`  bigint(20) NULL DEFAULT NULL COMMENT '访问id' ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8mb4 COLLATE=utf8mb4_general_ci
COMMENT='访问记录表'
AUTO_INCREMENT=8348

;

-- ----------------------------
-- Records of hy_visit_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Auto increment value for hy_article
-- ----------------------------
ALTER TABLE `hy_article` AUTO_INCREMENT=75;

-- ----------------------------
-- Auto increment value for hy_article_type
-- ----------------------------
ALTER TABLE `hy_article_type` AUTO_INCREMENT=52;

-- ----------------------------
-- Auto increment value for hy_banner
-- ----------------------------
ALTER TABLE `hy_banner` AUTO_INCREMENT=4;

-- ----------------------------
-- Auto increment value for hy_folder
-- ----------------------------
ALTER TABLE `hy_folder` AUTO_INCREMENT=1;

-- ----------------------------
-- Auto increment value for hy_operation_log
-- ----------------------------
ALTER TABLE `hy_operation_log` AUTO_INCREMENT=3;

-- ----------------------------
-- Auto increment value for hy_source
-- ----------------------------
ALTER TABLE `hy_source` AUTO_INCREMENT=6;

-- ----------------------------
-- Auto increment value for hy_user
-- ----------------------------
ALTER TABLE `hy_user` AUTO_INCREMENT=41;

-- ----------------------------
-- Auto increment value for hy_visit_log
-- ----------------------------
ALTER TABLE `hy_visit_log` AUTO_INCREMENT=8348;
